3.48 \(\int \cos ^2(\sqrt {x}) \, dx\)

Optimal. Leaf size=36 \[ \frac {x}{2}+\frac {1}{2} \cos ^2\left (\sqrt {x}\right )+\sqrt {x} \sin \left (\sqrt {x}\right ) \cos \left (\sqrt {x}\right ) \]

[Out]

1/2*x+1/2*cos(x^(1/2))^2+cos(x^(1/2))*sin(x^(1/2))*x^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3362, 3310, 30} \[ \frac {x}{2}+\frac {1}{2} \cos ^2\left (\sqrt {x}\right )+\sqrt {x} \sin \left (\sqrt {x}\right ) \cos \left (\sqrt {x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[Sqrt[x]]^2,x]

[Out]

x/2 + Cos[Sqrt[x]]^2/2 + Sqrt[x]*Cos[Sqrt[x]]*Sin[Sqrt[x]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 3362

Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.), x_Symbol] :> Dist[1/(n*f), Subst[Int[x
^(1/n - 1)*(a + b*Cos[c + d*x])^p, x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && In
tegerQ[1/n]

Rubi steps

\begin {align*} \int \cos ^2\left (\sqrt {x}\right ) \, dx &=2 \operatorname {Subst}\left (\int x \cos ^2(x) \, dx,x,\sqrt {x}\right )\\ &=\frac {1}{2} \cos ^2\left (\sqrt {x}\right )+\sqrt {x} \cos \left (\sqrt {x}\right ) \sin \left (\sqrt {x}\right )+\operatorname {Subst}\left (\int x \, dx,x,\sqrt {x}\right )\\ &=\frac {x}{2}+\frac {1}{2} \cos ^2\left (\sqrt {x}\right )+\sqrt {x} \cos \left (\sqrt {x}\right ) \sin \left (\sqrt {x}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 31, normalized size = 0.86 \[ \frac {1}{4} \left (2 \left (x+\sqrt {x} \sin \left (2 \sqrt {x}\right )\right )+\cos \left (2 \sqrt {x}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[Sqrt[x]]^2,x]

[Out]

(Cos[2*Sqrt[x]] + 2*(x + Sqrt[x]*Sin[2*Sqrt[x]]))/4

________________________________________________________________________________________

fricas [A]  time = 1.26, size = 24, normalized size = 0.67 \[ \sqrt {x} \cos \left (\sqrt {x}\right ) \sin \left (\sqrt {x}\right ) + \frac {1}{2} \, \cos \left (\sqrt {x}\right )^{2} + \frac {1}{2} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="fricas")

[Out]

sqrt(x)*cos(sqrt(x))*sin(sqrt(x)) + 1/2*cos(sqrt(x))^2 + 1/2*x

________________________________________________________________________________________

giac [A]  time = 0.41, size = 23, normalized size = 0.64 \[ \frac {1}{2} \, \sqrt {x} \sin \left (2 \, \sqrt {x}\right ) + \frac {1}{2} \, x + \frac {1}{4} \, \cos \left (2 \, \sqrt {x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="giac")

[Out]

1/2*sqrt(x)*sin(2*sqrt(x)) + 1/2*x + 1/4*cos(2*sqrt(x))

________________________________________________________________________________________

maple [A]  time = 0.02, size = 34, normalized size = 0.94 \[ 2 \sqrt {x}\, \left (\frac {\cos \left (\sqrt {x}\right ) \sin \left (\sqrt {x}\right )}{2}+\frac {\sqrt {x}}{2}\right )-\frac {x}{2}-\frac {\left (\sin ^{2}\left (\sqrt {x}\right )\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x^(1/2))^2,x)

[Out]

2*x^(1/2)*(1/2*cos(x^(1/2))*sin(x^(1/2))+1/2*x^(1/2))-1/2*x-1/2*sin(x^(1/2))^2

________________________________________________________________________________________

maxima [A]  time = 0.66, size = 23, normalized size = 0.64 \[ \frac {1}{2} \, \sqrt {x} \sin \left (2 \, \sqrt {x}\right ) + \frac {1}{2} \, x + \frac {1}{4} \, \cos \left (2 \, \sqrt {x}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x^(1/2))^2,x, algorithm="maxima")

[Out]

1/2*sqrt(x)*sin(2*sqrt(x)) + 1/2*x + 1/4*cos(2*sqrt(x))

________________________________________________________________________________________

mupad [B]  time = 0.35, size = 23, normalized size = 0.64 \[ \frac {x}{2}-\frac {{\sin \left (\sqrt {x}\right )}^2}{2}+\frac {\sqrt {x}\,\sin \left (2\,\sqrt {x}\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x^(1/2))^2,x)

[Out]

x/2 - sin(x^(1/2))^2/2 + (x^(1/2)*sin(2*x^(1/2)))/2

________________________________________________________________________________________

sympy [A]  time = 0.25, size = 51, normalized size = 1.42 \[ \sqrt {x} \sin {\left (\sqrt {x} \right )} \cos {\left (\sqrt {x} \right )} + \frac {x \sin ^{2}{\left (\sqrt {x} \right )}}{2} + \frac {x \cos ^{2}{\left (\sqrt {x} \right )}}{2} - \frac {\sin ^{2}{\left (\sqrt {x} \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x**(1/2))**2,x)

[Out]

sqrt(x)*sin(sqrt(x))*cos(sqrt(x)) + x*sin(sqrt(x))**2/2 + x*cos(sqrt(x))**2/2 - sin(sqrt(x))**2/2

________________________________________________________________________________________